package corej.review.lxf.oop.entity;

public abstract class Database implements Comparable {

    private String ip;

    private int port;

    private String name;

    public Database(String ip, int port) {
        this.ip = ip;
        this.port = port;
    }

    /**
     * ����name
     *
     * @return the name
     */
    public String setName(String name) {
        return this.name = name;
    }

    /**
     * �õ�name
     *
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * �õ�ip
     *
     * @return the ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * �õ�port
     *
     * @return the port
     */
    public int getPort() {
        return port;
    }

    public int compareTo(Object other) {
        if (other == null) {
            return 1;
        }

        if (!(other instanceof Database)) {
            return 1;
        }

        Database db = (Database) other;

		return name.compareTo(db.getName());
	}

}
